package com.bases {
	import com.Interface.ISelect;
	import com.skin.SkinManage;

	/**
	 * 多选按钮
	 * @author pethan
	 *
	 */
	public class TCheckButton extends TUIComponent implements ISelect {
		private var btnSelect:ImageButton;
		private var btnNotSelect:ImageButton;
		private var _select:Boolean = false;

		public function TCheckButton(){
			super();
			btnSelect = new ImageButton(SkinManage.getInstance().getClass('CheckBoxSelectUp'), SkinManage.getInstance().getClass('CheckBoxSelectUp'), SkinManage.getInstance().getClass('CheckBoxSelectUp'));
			btnSelect.visible = false;
			btnNotSelect = new ImageButton(SkinManage.getInstance().getClass('CheckBoxNotSelect'), SkinManage.getInstance().getClass('CheckBoxNotSelect'), SkinManage.getInstance().getClass('CheckBoxNotSelect'));
			this.addChilds(btnSelect, btnNotSelect);
		}

		public function set select(value:Boolean):void {
			if (value == true){
				this.btnSelect.visible = true;
				this.btnNotSelect.visible = false;
			} else {
				this.btnNotSelect.visible = true;
				this.btnSelect.visible = false;
			}
			_select = value;
		}

		/**
		 *
		 * @return
		 *
		 */
		public function get select():Boolean {
			return _select;
		}
	}
}